// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import ElementUI from 'element-ui'
import Vuex from 'vuex'
import mavonEditor from 'mavon-editor'
import 'mavon-editor/dist/css/index.css'
import './icon/iconfont.css'
// import axios from 'axios'

import 'element-ui/lib/theme-default/index.css'
import VueResource from 'vue-resource'

Vue.use(VueResource)
Vue.use(ElementUI)
Vue.use(Vuex)
Vue.use(mavonEditor)
// Vue.prototype.$ajax = axios

Vue.config.productionTip = false

/* eslint-disable no-new */

let store = new Vuex.Store({
  state: {
    totalPrice: 0,
    user_id: 0
  },
  mutations: {
    increment (state, price) {
      state.totalPrice += price
    },
    getUser_id (state, userid) {
      console.log('提交到vuex', userid)
      sessionStorage.setItem('user_id', userid)
      state.user_id = userid
    }
  }
})
new Vue({
  el: '#app',
  router,
  store,
  template: '<App/>',
  components: {App}
})
